package com.peanut.bosskg.service.other.balance;

import com.alibaba.fastjson.JSON;
import com.peanut.bosskg.entity.ResponseMessageVO;
import com.peanut.bosskg.entity.balance.SohoBalanceDTO;
import com.peanut.bosskg.enums.FunCodeEnum;
import com.peanut.bosskg.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @param
 * @author LMH
 * @return
 * @description 自由职业者可下发额度查询接口
 * @createby 2022-06-09 9:13
 */
@Service
@Slf4j
public class SohoBalanceQueryService extends BaseService {

    /**
     * @param funCodeEnum
     * @param sohoBalanceDTO
     * @return
     * @throws Exception
     */
    public SohoBalanceDTO doBusiness(FunCodeEnum funCodeEnum, SohoBalanceDTO sohoBalanceDTO) throws Exception {
        log.info("用户签约查询接口开始:{}，{}", funCodeEnum, sohoBalanceDTO);
        ResponseMessageVO responseMessage = applyYouFuByHttpPost(funCodeEnum, sohoBalanceDTO);
        SohoBalanceDTO sohoDTO = JSON.parseObject(responseMessage.getResData(), SohoBalanceDTO.class);
        log.info("用户签约查询接口结束:{}", sohoDTO);
        return sohoDTO;
    }
}
